package com.example.customviewtest.wymusic;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.customviewtest.R;

import jp.wasabeef.glide.transformations.BlurTransformation;

public class PlayMusicActivity extends AppCompatActivity implements View.OnClickListener {

    private ImageView mPaly_music_img_bg;
    private TextView mPlay_tv_nname;
    private TextView mPlay_tv_aurth;
    private DiskView mDisk_view;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_play_music);
        Intent intent = getIntent();
        String author = intent.getStringExtra("author");
        String name = intent.getStringExtra("name");
        String poster = intent.getStringExtra("poster");
        String path = intent.getStringExtra("path");
        mPaly_music_img_bg = findViewById(R.id.paly_music_img_bg);
        mPlay_tv_nname = findViewById(R.id.play_tv_nname);
        mPlay_tv_aurth = findViewById(R.id.play_tv_aurth);
        findViewById(R.id.paly_music_paly_img).setOnClickListener(this);
        mPlay_tv_aurth.setText(author);
        mPlay_tv_nname.setText(name);
        mDisk_view = findViewById(R.id.disk_view);
        mDisk_view.setImage_pat(poster);
        Glide.with(this).load(poster).transform(new BlurTransformation(25, 25)).into(mPaly_music_img_bg);
    }

    @Override
    public void onClick(View v) {
        mDisk_view.controlPlay();
    }
}
